CollapseDrafts
Document ShellThe CollapseDrafts method removes the specified range of empty drafts from this document.
ODDocument CollapseDrafts (in ODDraft from, in ODDraft to);
from
- A reference to the first (most recent) draft in the range.
to
- A reference to the last (oldest) draft in the range.
- return value
- A reference to this document with the specified drafts removed.
DISCUSSION
If theto
parameter iskODNULL
, it is set to the draft immediately previous to (below) thefrom
draft. When successful, this method removes all the drafts between thefrom
draft (inclusive) and theto
draft (exclusive), and returns a reference to the amended document object. This method maintains the appropriate draft topology for this document. After successful execution, thefrom
draft is no longer a valid draft object.For this method to be successful, the following conditions must all be met:
Before calling this method, the document shell or container application can call the
- The
from
draft itself must have a reference count of 1, meaning that only the caller has a reference to that draft object.- The
from
draft must not be this document's base draft and must be more recent than (above) theto
draft in this document's draft history.- All the drafts targeted for removal must be empty. A draft is empty if it contains no changes from its previous draft.
- There must be no outstanding drafts between the
from
draft (exclusive) and theto
draft (exclusive). An outstanding draft has a reference count greater than 0, meaning that it is being used by some object.
SaveToAPrevDraft
method to consolidate the changes in a range of drafts.EXCEPTIONS
kODErrCannotCollapseDrafts
- The
from
draft is not a more recent draft than theto
draft.kODErrNonEmptyDraft
- There are non-empty draft(s) between the
from
draft (inclusive) and theto
draft (exclusive).kODErrOutstandingDraft
- There are outstanding drafts between the
from
draft (exclusive) and theto
draft (exclusive) or thefrom
draft has a reference count greater than 1.SEE ALSO
TheODDocument::SaveToAPrevDraft
method (page 144).
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help